package com.zh.common.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.annotations.Select;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * code is far away from bug with the animal protecting
 * ┏┓　　　┏┓
 * ┏┛┻━━━┛┻┓
 * ┃　　　　　　　┃
 * ┃　　　━　　　┃
 * ┃　┳┛　┗┳　┃
 * ┃　　　　　　　┃
 * ┃　　　┻　　　┃
 * ┃　　　　　　　┃
 * ┗━┓　　　┏━┛
 * 　　┃　　　┃神兽保佑
 * 　　┃　　　┃代码无BUG！
 * 　　┃　　　┗━━━┓
 * 　　┃　　　　　　　┣┓
 * 　　┃　　　　　　　┏┛
 * 　　┗┓┓┏━┳┓┏┛
 * 　　　┃┫┫　┃┫┫
 * 　　　┗┻┛　┗┻┛
 *
 * @Description: 公共基础类
 * @Author: Li.HuiNeng
 * @Create in: 2019/8/22
 * @Version: 1.0.1
 */
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
public abstract class BaseEntity extends Model<BaseEntity> {

    private static final long serialVersionUID = 2526016935064528622L;

    @ApiModelProperty(value = "开始日期", name = "startDate")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @TableField(exist = false, select = false)
    private Date startDate;

    @ApiModelProperty(value = "结束日期", name = "endDate")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @TableField(exist = false, select = false)
    private Date endDate;


    @ApiModelProperty(value = "开始时间", name = "startDateTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false, select = false)
    private Date startDateTime;


    @ApiModelProperty(value = "结束时间", name = "endDateTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false, select = false)
    private Date endDateTime;

    @ApiModelProperty(value = "审核开始时间", name = "auditTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false, select = false)
    private Date auditStartTime;


    @ApiModelProperty(value = "审核结束时间", name = "auditEndTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false, select = false)
    private Date auditEndTime;


    @ApiModelProperty(value = "修改开始时间", name = "modStartTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false, select = false)
    private Date modStartTime;


    @ApiModelProperty(value = "修改结束时间", name = "modEndTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false, select = false)
    private Date modEndTime;

    @ApiModelProperty(value = "添加开始时间", name = "addStartTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false, select = false)
    private Date addStartTime;

    @ApiModelProperty(value = "交易开始时间", name = "transStartTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false, select = false)
    private Date transStartTime;


    @ApiModelProperty(value = "交易结束时间", name = "transEndTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false, select = false)
    private Date transEndTime;


    @ApiModelProperty(value = "添加结束时间", name = "addEndTime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false, select = false)
    private Date addEndTime;

    @ApiModelProperty(value = "开始时间(HH:mm:ss)", name = "StartTime")
    @TableField(exist = false, select = false)
    private String startTime;

    @ApiModelProperty(value = "结束时间(HH:mm:ss)", name = "EndTime")
    @TableField(exist = false, select = false)
    private String endTime;

    @ApiModelProperty(value = "开始金额", name = "amtStart")
    @TableField(exist = false, select = false)
    private Float amtStart;

    @ApiModelProperty(value = "结束金额", name = "amtEnd")
    @TableField(exist = false, select = false)
    private Float amtEnd;


    @ApiModelProperty(value = "版本号(用与加锁)", name = "version")
    @TableField(exist = false, select = false)
    private Integer version;

    @ApiModelProperty(value = "二维码费率json字符串", name = "qrCodeRateJson")
    @TableField(exist = false)
    private String qrCodeRateJson;

    @ApiModelProperty(value = "银行卡费率json字符串", name = "bankCardRateJson")
    @TableField(exist = false)
    private String bankCardRateJson;

    @ApiModelProperty(value = "网关费率json字符串", name = "gatewayRateJson")
    @TableField(exist = false)
    private String gatewayRateJson;

    @ApiModelProperty(value = "快捷支付成本费率json字符串", name = "quickRateJson")
    @TableField(exist = false)
    private String quickRateJson;

    @ApiModelProperty(value = "总笔数", name = "num")
    @TableField(exist = false)
    private Integer num;

    @ApiModelProperty(value = "用于展示树时的值", name = "no")
    @TableField(exist = false)
    private String value;

    @ApiModelProperty(value = "用于展示树时的名称", name = "label")
    @TableField(exist = false)
    private String label;

    @ApiModelProperty(value = "是否为最后的节点", name = "isLeaf")
    @TableField(exist = false)
    private Boolean isLeaf;

    public BaseEntity() { }

    public BaseEntity(int pageNo, int pageSize, int version) {
        this.version = version;
    }
}
